---
title: Pay online
summary: How the NDReimbursement screen creates a OneInc payment request.
status: generated
owner: SAIF Case Management
last_reviewed: 2026-10-20
---

# Pay online

## Steps

1. The user selects Pay Online. `PaymentModal.js` posts `totalAmount`, `maxAmount` and `policyNum` to `/NDReimbursement/PayOnline` with no anti-forgery token ([BR-APP-006](../business-rules.md#br-app-006)).
2. The handler requires `0 < total <= max` ([BR-SCR-007](../business-rules.md#br-scr-007)); otherwise it returns null. `max` and the policy number come from the client (TD-APP-006).
3. `OneIncService` creates the payment request through `OneIncAPIClient.CreateMakePaymentRequest` (known from the call site in `OneIncService.cs`; package internals are unknown**), and the script opens the portalOne modal.
4. If the call throws, the handler logs the exception and returns null, the same result as a failed amount check. Pending online payments later block the claims-saved state ([BR-SCR-008](../business-rules.md#br-scr-008)).

## Process flow

The diagram shows the amount check, the payment-request call and the null result returned when validation fails or an exception is caught.

```mermaid
flowchart TD
    A["Pay Online"] --> B["POST PayOnline"]
    B --> C{"0 < total <= max?"}
    C -- No --> D["Return null"]
    C -- Yes --> E["Create payment request via OneIncAPIClient"]
    E -- "Success" --> F["Open payment modal"]
    E -- "Exception caught, logged" --> D
```

> **Note:** Statements marked with `**` could
> not be confirmed; treat as unknown until verified.

## Related documentation
- [Application index](../index.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Hosted endpoints](../hosted-endpoints.md)

## Sources
- src/NDReimbursementWebApp/Pages/NDReimbursement.cshtml.cs
- src/NDReimbursementWebApp/wwwroot/js/PaymentModal.js
- src/NDReimbursementWebApp/Services/OneIncService.cs
